{/* LAYOUT模板 */}
<layout name="layout"/>
{/* LAYOUT模板 */}
{/* import Js,Css */}	
<css href="__THEMES__/css/common.css"/>
<css href="__PUBLIC__/css/jquery-ui.css" />
<css href="__THEMES__/css/user.css" />
<js href="__PUBLIC__/js/core/jquery-ui.1.10.4.js" />
<js href="__PUBLIC__/js/core/plugins.js" />
<js href="__PUBLIC__/js/core/jquery.form.js" />
<js href="__PUBLIC__/js/region.js" />
{/* import js,css */}
<include file="User:l_user_nav"/>
<!--添加收获地址-->
<div id="dialog" class="hide"><include file="User:l_add_address"/></div>
<div id="mod-address-dialog" class="hide"></div>
<!--添加收获地址-->
<div id="loading"></div>
<style>
#dialog .d-title{display:block;height:40px;font-size:20px;line-height:35px;text-indent:20px;border-bottom:2px solid #009DE4;color:#009DE4;}
#dialog .qs-close-button-1{color:#404040; position:absolute;top:-3px;right:-47px;width:45px;line-height:43px;text-align:center;height:45px;font-size:30px;background-color:#e0e0e0;cursor:pointer;}
#dialog .check-mail-wrap{display:block;relative;}
#dialog .check-mail-wrap ul{margin-left:30px;}
#dialog .check-mail-wrap li{display:block; float:left;}
.qs-send-btn{font-size:16px;outline:none;height:33px;width:100px;border:1px solid #FF3D00;background-color:#fff;color:#FF3D00;cursor:pointer;border-radius:3px;margin-left:20px;vertical-align:center;text-align:center;}
</style>
<!--用户中心导航-->
<div>
	<div class="w_1200 mp20 clearfix">
		<!--左边栏-->
		<div class="LBanner fl w20">
			<include file="User:user_menu"/>
		</div>
		<!--左边栏-->
		<!--右边栏-->
		<div class="RBanner fr w79 ">
			<!--右边对应左边栏内容-->						
				<!--#收货地址页面 -->
				<if condition="$action eq 'address_list'">	
					<div class="xm-line-box uc-box">
						<div class="box-hd">
							<h3 class="title">
								{$lang.consignee_info}
							</h3>			
						</div>
						<div class="">
							<style>
							.qs-address-list{padding-top:20px;}
							.qs-address-item,.qs-address-item dt,.qs-address-item dd,.add-address strong{display:block;}
							.qs-address-item {width:295px;height:192px;float:left;border: 1px solid #dfdfdf;cursor:pointer;background: #fafafa;margin:0px 0px 10px 10px;}
							.qs-address-item dt {height:35px;border-bottom:1px solid #dfdfdf;margin:10px;line-height:35px;}
							.qs-address-item dt strong{color:#333;font-size:14px;font-weight:500;}
							.qs-address-item dd {margin:10px;}
							.qs-address-item dd p {font-size:14px;line-height:22px;color:#6d6d6d;}
							.qs-address-item dd a{display:inline-block;width: 58px;height: 18px;line-height: 18px;margin-top: 8px;text-align: center;color: #333;font-size: 12px;cursor: pointer;border: 1px solid #dfdfdf;}
							.add-address strong{font-size:50px;color:#adadad;text-align:center;margin-top:30px;}
							.add-address p{display:inline-block;font-size:16px;color:#adadad;text-align:center;width:100%;}
							</style>
							<div class="qs-address-list clearfix">	
								<include file="User:l_address_list"/>
							</div>
						</div>
					</div>					
				</if>
				<!--#收货地址添加页面 -->				
			<!--右边对应左边栏内容-->
		</div>
		<!--右边栏-->
	</div>
</div>
<!--用户中心导航-->
<script>
$(document).ready(function(){	
	$('#add-address').live('click',function(){
		$('#dialog').Qdialog({
			width:700,
			height:400,
			modal:true
		});
	});
	/*提交地址*/
	$('.qs-ui-submit-btn').live('click',function(){
		var values = $('.add-address-wrap').QVal();
		/*省,市/县,区*/		
		/*名,手机*/
		$.ajax({
			url:"{:U('user/ajaxc_consignee')}",			
			type:'post',
			dataType:'json',		
			data:values,
			beforeSend:function(){
				$('#loading').QLoading({text:'',modal:true,status:'open'});
				$('#dialog').dialog('close');
			},
			success:function(msg){
				$('#loading').QLoading({text:'',modal:true,status:'close'});				
				$('.qs-address-list').html(msg.info);	
				/*清空表单*/
				$('#add-address-form').clearForm();
			},
			error:function(XMLHttpRequest, textStatus, errorThrown){}
		});
	});
	/*删除收获人地址*/
	$('.qs-del-btn').live('click',function(){
		var address_id = $(this).attr('address_id');
		if(confirm('确定删除')){
			$.ajax({
				url:"{:U('user/ajaxc_consignee')}",			
				type:'post',
				dataType:'json',		
				data:{act:'del',address_id:address_id},
				beforeSend:function(){
					$('#loading').QLoading({text:'',modal:true,status:'open'});
				},
				success:function(msg){
					if(msg.info == '1'){
						$('#consignee-' + address_id).remove();
						$('#loading').QLoading({text:'',modal:true,status:'close'});				
					}
					else{
						$('#loading').QLoading({text:'删除失败',img:'sad',modal:true,status:'close',time:1});
					}
				},
				error:function(XMLHttpRequest, textStatus, errorThrown){}
			});
		}
	});
	/*修改收获人信息*/
	$('.qs-edit-btn').live('click',function(){
		var address_id = $(this).attr('address_id');
		$.ajax({
			url:"{:U('user/mod_consignee')}",			
			type:'post',
			dataType:'json',		
			data:{act:'del',address_id:address_id},
			beforeSend:function(){
				$('#loading').QLoading({text:'',modal:true,status:'open'});
			},
			success:function(msg){				
				$('#loading').QLoading({text:'',modal:true,status:'close'});				
				/*加入html*/				
				$('#dialog').html(msg.info);
				$('#dialog').Qdialog({
					width:700,
					height:400,
					modal:true
				});
			},
			error:function(XMLHttpRequest, textStatus, errorThrown){}
		});
	});
});	
</script>

<div class="space100" style="height:100px;"></div>

<include file="Library:service"/>
<include file="Library:footer"/>


